package com.niiwoo.civet.user.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 用户个人资料状态
 */
@AllArgsConstructor
@Getter
public enum UserPersonalInfoStatusEnum {

    NOT_FILL((byte) 1, "未填写"),
    FINISHED((byte) 2, "已完成");

    private Byte value;

    private String text;

    public static UserPersonalInfoStatusEnum of(Byte value) {
        if (value != null) {
            for (UserPersonalInfoStatusEnum s : values()) {
                if (s.value.equals(value)) {
                    return s;
                }
            }
        }
        return null;
    }

    public static boolean except(Byte value, UserPersonalInfoStatusEnum... status) {
        return (status != null && status.length > 0) && Arrays.asList(status).contains(of(value));
    }

}
